<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<script language="javascript">
var id;
var name;
function popUpWin(backId, backName) {

	id = backId;
	name = backName;
	
	$('#projectPopUp').window({
			title: '选择项目',
			modal: true,
			shadow: false,
			closed: false,
			collapsible: false,
			minimizable: false,
			maximizable: false,
			width: 480,
			height: 400
		});
	  doQuery('');
}

function query(value,name){
	var condition = "query_projectName="+encodeURIComponent(value);
	doQuery(condition);
}

function doQuery(condition) {
	$('#popUpDataTable').datagrid(
			{
				url: "project_dataGridAction.action?"+condition,
				width: '430',
				height: 'auto',
				striped: true,
				fitColumns: false,
				pagination:true,
				columns:[[
					{field:'projectCode',title:'项目编号',width:130,
						formatter:function(value,rowData,rowIndex){
							return '<a href="#" onclick="selected(\''+rowData['projectId']+'\', \''+rowData['projectName']+'\')">' + value + '</a>';
						}},
					{field:'projectName',title:'项目名称',width:295}
				]]
			});
}

function selected(idValue, nameValue) {
	
	popUpCallback(id, name, idValue, nameValue);
	
	$('#projectPopUp').window('close');
}
</script>
</head>

<body>

<div id="projectPopUp" class="easyui-window" closed="true" iconCls="icon-save" style="width:500px;height:380px;padding:5px;">
	<div class="easyui-layout" fit="true">
		<div region="center" border="false" style="padding:10px;background:#fff;border:1px solid #ccc;">

			<input id="ss" class="easyui-searchbox"
					searcher="query"
					prompt="Please Input Value" menu="#mm" style="width:430px"></input>
			<div id="mm" style="width:120px">
				<div name="projectName" iconCls="icon-ok">项目名称</div>
			</div>
			
			<p>
			
			<div style="width: 100%;">
				<table id="popUpDataTable" title='项目列表'></table>
			</div>

		</div>
	</div>
</div>

</body>
</html>